rtc23 2.2.1
Loading...
Searching...
No Matches
rtc23.h File Reference

This file contains API for RTC 23 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  rtc23_t
 RTC 23 Click context object. More...
struct  rtc23_cfg_t
 RTC 23 Click configuration object. More...
struct  rtc23_time_t
 RTC 23 Click time object. More...
struct  rtc23_date_t
 RTC 23 Click date object. More...

Macros

#define RTC23_REG_HUNDREDTHS   0x00
 RTC 23 register list.
#define RTC23_REG_SECONDS   0x01
#define RTC23_REG_MINUTES   0x02
#define RTC23_REG_HOURS   0x03
#define RTC23_REG_DATE   0x04
#define RTC23_REG_MONTHS   0x05
#define RTC23_REG_YEARS   0x06
#define RTC23_REG_WEEKDAYS   0x07
#define RTC23_REG_HUNDREDTHS_ALARM   0x08
#define RTC23_REG_SECONDS_ALARM   0x09
#define RTC23_REG_MINUTES_ALARM   0x0A
#define RTC23_REG_HOURS_ALARM   0x0B
#define RTC23_REG_DATE_ALARM   0x0C
#define RTC23_REG_MONTHS_ALARM   0x0D
#define RTC23_REG_WEEKDAYS_ALARM   0x0E
#define RTC23_REG_STATUS   0x0F
#define RTC23_REG_CONTROL1   0x10
#define RTC23_REG_CONTROL2   0x11
#define RTC23_REG_INT_MASK   0x12
#define RTC23_REG_SQW   0x13
#define RTC23_REG_CAL_XT   0x14
#define RTC23_REG_CAL_RC_HI   0x15
#define RTC23_REG_CAL_RC_LOW   0x16
#define RTC23_REG_SLEEP_CONTROL   0x17
#define RTC23_REG_TIMER_CONTROL   0x18
#define RTC23_REG_TIMER   0x19
#define RTC23_REG_TIMER_INITIAL   0x1A
#define RTC23_REG_WDT   0x1B
#define RTC23_REG_OSC_CONTROL   0x1C
#define RTC23_REG_OSC_STATUS   0x1D
#define RTC23_REG_CONFIGURATION_KEY   0x1F
#define RTC23_REG_TRICKLE   0x20
#define RTC23_REG_BREF_CONTROL   0x21
#define RTC23_REG_AFCTRL   0x26
#define RTC23_REG_BATMODE_IO   0x27
#define RTC23_REG_ID0   0x28
#define RTC23_REG_ID1   0x29
#define RTC23_REG_ID2   0x2A
#define RTC23_REG_ID3   0x2B
#define RTC23_REG_ID4   0x2C
#define RTC23_REG_ID5   0x2D
#define RTC23_REG_ID6   0x2E
#define RTC23_REG_ASTAT   0x2F
#define RTC23_REG_OCTRL   0x30
#define RTC23_REG_EXTENSION_ADDRESS   0x3F
#define RTC23_REG_RAM   0x40
#define RTC23_MONDAY   0x00
 RTC 23 day of week values.
#define RTC23_TUESDAY   0x01
#define RTC23_WEDNESDAY   0x02
#define RTC23_THURSDAY   0x03
#define RTC23_FRIDAY   0x04
#define RTC23_SATURDAY   0x05
#define RTC23_SUNDAY   0x06
#define RTC23_DEVICE_ID   0x18
 RTC 23 device ID value.
#define RTC23_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
#define RTC23_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
#define RTC23_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Enumerations

enum  rtc23_return_value_t { RTC23_OK = 0 , RTC23_ERROR = -1 }
 RTC 23 Click return value data. More...

Functions

void rtc23_cfg_setup (rtc23_cfg_t *cfg)
 RTC 23 configuration object setup function.
err_t rtc23_init (rtc23_t *ctx, rtc23_cfg_t *cfg)
 RTC 23 initialization function.
err_t rtc23_write_regs (rtc23_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 RTC 23 write regs function.
err_t rtc23_read_regs (rtc23_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 RTC 23 read regs function.
err_t rtc23_write_reg (rtc23_t *ctx, uint8_t reg, uint8_t data_in)
 RTC 23 write reg function.
err_t rtc23_read_reg (rtc23_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 23 read reg function.
void rtc23_set_wdi_pin (rtc23_t *ctx, uint8_t state)
 RTC 23 set WDI pin function.
uint8_t rtc23_get_psw_pin (rtc23_t *ctx)
 RTC 23 get PSW pin function.
uint8_t rtc23_get_int_pin (rtc23_t *ctx)
 RTC 23 get INT pin function.
err_t rtc23_check_communication (rtc23_t *ctx)
 RTC 23 check communication function.
err_t rtc23_set_time (rtc23_t *ctx, rtc23_time_t *time)
 RTC 23 set time function.
err_t rtc23_read_time (rtc23_t *ctx, rtc23_time_t *time)
 RTC 23 read time function.
err_t rtc23_set_date (rtc23_t *ctx, rtc23_date_t *date)
 RTC 23 set date function.
err_t rtc23_read_date (rtc23_t *ctx, rtc23_date_t *date)
 RTC 23 read date function.

Detailed Description

This file contains API for RTC 23 Click Driver.

Enumeration Type Documentation

◆ rtc23_return_value_t

RTC 23 Click return value data.

Predefined enum values for driver return values.

Enumerator
RTC23_OK 
RTC23_ERROR